package com.zq.zhufengfm.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Project_name : ZhuFengFM
 * Author : zhaoQiang
 * Date : 2015/10/24,10:21
 * Email : zhaoq_hero@163.com
 */

//曲目详情:
public class Tracks implements Parcelable{

     /**
      * 静态的对象必须要存在  并且名称必须是CREATOR
      * 作用用於  返學裂化
      */
     public static final Creator<Tracks> CREATOR = new Creator<Tracks>() {

         /**
          * 反序列化方法  与  writeToParce对应
          * @param source
          * @return
          */
          @Override
          public Tracks createFromParcel(Parcel source) {
              Tracks tracks = new Tracks();

              tracks.albumId = source.readLong();

              tracks.trackId = source.readLong();

              tracks.title = source.readString();

              tracks.playtimes = source.readString();

              tracks.coverLarge = source.readString();

              tracks.downloadAacUrl = source.readString();

              tracks.downloadUrl = source.readString();

              tracks.playPathAacv164 = source.readString();

              tracks.playPathAacv224 = source.readString();

              return tracks;
          }

          /**
           * 当反序列化的  是一个数组的时候，掉用这个方法
           * @param size 数组元素对象个数
           * @return new Track[size]
           */
          @Override
          public Tracks[] newArray(int size) {
            return new Tracks[size];
           }

     };

     private String title; //标题
     private long albumId;//专辑Id
     private long trackId;//曲目ID
     private String playtimes;//播放次数

    private String playPathAacv164;//播放路径
    private String playPathAacv224;//播放路径
    private String downloadUrl;//下载路径
    private String downloadAacUrl;//下载路径

     private String coverLarge;//大图标：

     @Override
     public int describeContents() {
            return 0;
     }
         /**
          * 当对象需要进行序列化的时候，系统会自动调用这个方法，
          * 将对象转换为字节数组，进行序列化操作
          * @param dest
          * @param flags
          */
         @Override
         public void writeToParcel(Parcel dest, int flags) {

           dest.writeLong(albumId);

           dest.writeLong(trackId);

           dest.writeString(title);

             dest.writeString(playtimes);

             dest.writeString(coverLarge);

             dest.writeString(downloadAacUrl);
             dest.writeString(downloadUrl);
             dest.writeString(playPathAacv164);
             dest.writeString(playPathAacv224);

          }
         /**
         * /**
         * tracks": {
         "list": [
         {
         "trackId": 9427338,
         "uid": 12495477,
         "playUrl64": "http://fdfs.xmcdn.com/group12/M02/89/A6/wKgDXFYoz1ezfzYrAPmmff-oc0Q305.mp3",
         "playUrl32": "http://fdfs.xmcdn.com/group16/M01/8A/48/wKgDbFYoz0ziO1BhAHzTY4lFcFQ989.mp3",
         "downloadUrl": "http://download.xmcdn.com/group11/M02/96/5A/wKgDbVYoz0KiDwRsAIGHpN82kYQ158.aac",
         "playPathAacv164": "http://audio.xmcdn.com/group12/M02/89/A6/wKgDXFYoz1OxjFj-APxck0CbZLA107.m4a",
         "playPathAacv224": "http://audio.xmcdn.com/group11/M02/7D/6C/wKgDa1Yoz0XCxr6eAGBUDG9paGI027.m4a",
         "downloadAacUrl": "http://audio.xmcdn.com/group11/M02/7D/6C/wKgDa1Yoz0XCxr6eAGBUDG9paGI027.m4a",
         "title": "吴晓波:\"跑男\"李嘉诚",
         "duration": 2045.09,
         "processState": 2,
         "createdAt": 1445515338000,
         "coverSmall": "http://fdfs.xmcdn.com/group9/M05/33/D5/wKgDZlWTeKfgdqYbAArO7X1ML0w087_web_meduim.jpg",
         "coverMiddle": "http://fdfs.xmcdn.com/group9/M05/33/D5/wKgDZlWTeKfgdqYbAArO7X1ML0w087_web_large.jpg",
         "coverLarge": "http://fdfs.xmcdn.com/group9/M05/33/D5/wKgDZlWTeKfgdqYbAArO7X1ML0w087_mobile_large.jpg",
         "nickname": "吴晓波频道",
         "smallLogo": "http://fdfs.xmcdn.com/group4/M04/D0/51/wKgDtFP2qljgWGrYAAR86TSbKQg782_mobile_small.jpg",
         "userSource": 1,
         "albumId": 269179,
         "albumTitle": "吴晓波频道",
         "albumImage": "http://fdfs.xmcdn.com/group5/M06/D5/8C/wKgDtlSJEZvxIRaKAArO7X1ML0w347_mobile_small.jpg",
         "orderNum": 99999999,
         "opType": 1,
         "isPublic": true,
         "likes": 182,
         "playtimes": 110158,
         "comments": 43,
         "shares": 0,
         "status": 1,
         "downloadSize": 8488868,
         "downloadAacSize": 6312972
         }
         */

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public static Creator<Tracks> getCREATOR() {
        return CREATOR;
    }

    public long getAlbumId() {
        return albumId;
    }

    public void setAlbumId(long albumId) {
        this.albumId = albumId;
    }

    public long getTrackId() {
        return trackId;
    }

    public void setTrackId(long trackId) {
        this.trackId = trackId;
    }

    public String getPlaytimes() {
        return playtimes;
    }

    public void setPlaytimes(String playtimes) {
        this.playtimes = playtimes;
    }

    public String getCoverLarge() {
        return coverLarge;
    }

    public void setCoverLarge(String coverLarge) {
        this.coverLarge = coverLarge;
    }

    public String getDownloadAacUrl() {
        return downloadAacUrl;
    }

    public void setDownloadAacUrl(String downloadAacUrl) {
        this.downloadAacUrl = downloadAacUrl;
    }

    public String getDownloadUrl() {
        return downloadUrl;
    }

    public void setDownloadUrl(String downloadUrl) {
        this.downloadUrl = downloadUrl;
    }

    public String getPlayPathAacv224() {
        return playPathAacv224;
    }

    public void setPlayPathAacv224(String playPathAacv224) {
        this.playPathAacv224 = playPathAacv224;
    }

    public String getPlayPathAacv164() {
        return playPathAacv164;
    }

    public void setPlayPathAacv164(String playPathAacv164) {
        this.playPathAacv164 = playPathAacv164;
    }

    @Override
    public String toString() {
        return "Tracks{" +
                "title='" + title + '\'' +
                ", albumId=" + albumId +
                ", trackId=" + trackId +
                ", playtimes='" + playtimes + '\'' +
                ", playPathAacv164='" + playPathAacv164 + '\'' +
                ", playPathAacv224='" + playPathAacv224 + '\'' +
                ", downloadUrl='" + downloadUrl + '\'' +
                ", downloadAacUrl='" + downloadAacUrl + '\'' +
                ", coverLarge='" + coverLarge + '\'' +
                '}';
    }

}
